<?php
/**
 * Created by PhpStorm.
 * User: wanglei
 * Date: 2016/4/10
 * Time: 23:26
 */
namespace App\Repositories;
trait SingleRepositoryTrait
{
    public static $_instance = null;
    private function __construct() {
    }
    private function __clone() {
    }
    public static function getInstance()
    {
        if (is_null ( self::$_instance ) || isset ( self::$_instance )) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
}